set kaziy to (8.0 * abs(sin(PI * (dive - 20)))) + 1.0
addAt(alieny, kazi, temp + kaziy)
if (getAt(alieny, kazi) > 315) and (getAt(alieny, kazi) < 365) and (getAt(alienblow, kazi) = 6) and (shipcast = 1) and sprite (kazi + 2) intersects 40 then
set collide to 1
set the castNum of sprite (kazi + 2) to 7
deleteAt(alienblow, kazi)
addAt(alienblow, kazi, 7)
end if
if getAt(alieny, kazi) > 500 then
set dive to -1
end if
else
if dive = -1 then
deleteAt(alienx, kazi)
deleteAt(alieny, kazi)
addAt(alienx, kazi, diverx)
addAt(alieny, kazi, -10)
set dive to -2
else
if dive = -2 then
set temp to getAt(alienx, kazi)
deleteAt(alienx, kazi)
addAt(alienx, kazi, temp + (direct * 2))
set temp to getAt(alieny, kazi)
deleteAt(alieny, kazi)
addAt(alieny, kazi, temp + 2.5)
if getAt(alieny, kazi) = divery then
set dive to 0
set kazi to 0
end if
end if
end if
end if
end if
end if
set column1 to getAt(alienblow, 1) + getAt(alienblow, 2)
set column2 to getAt(alienblow, 3) + getAt(alienblow, 4) + getAt(alienblow, 5) + getAt(alienblow, 6)
set column3 to getAt(alienblow, 7) + getAt(alienblow, 8) + getAt(alienblow, 9) + getAt(alienblow, 10)
set column4 to getAt(alienblow, 11) + getAt(alienblow, 12) + getAt(alienblow, 13) + getAt(alienblow, 14)
set column5 to getAt(alienblow, 15) + getAt(alienblow, 16) + getAt(alienblow, 17) + getAt(alienblow, 18) + getAt(alienblow, 19)
set column6 to getAt(alienblow, 20) + getAt(alienblow, 21) + getAt(alienblow, 22) + getAt(alienblow, 23)
set column7 to getAt(alienblow, 24) + getAt(alienblow, 25) + getAt(alienblow, 26) + getAt(alienblow, 27)
set column8 to getAt(alienblow, 28) + getAt(alienblow, 29) + getAt(alienblow, 30) + getAt(alienblow, 31)
set column9 to getAt(alienblow, 32) + getAt(alienblow, 33)
if column1 > 0 then
set left to 0
else
if column2 > 0 then
set left to 1
else
if column3 > 0 then
set left to 2
else
if column4 > 0 then
set left to 3
else
if column5 > 0 then
set left to 4
else
if column6 > 0 then
set left to 5
else
if column7 > 0 then
set left to 6
else
if column8 > 0 then
set left to 7
else
set left to 8
end if
end if
end if
end if
end if
end if
end if
end if
if column9 > 0 then
set right to 0
else
if column8 > 0 then
set right to 1
else
if column7 > 0 then
set right to 2
else
if column6 > 0 then
set right to 3
else
if column5 > 0 then
set right to 4
else
if column4 > 0 then
set right to 5
else
if column3 > 0 then
set right to 6
else
if column2 > 0 then
set right to 7
else
if column1 > 0 then
set right to 8
else
if clear = 0 then
set clear to 1
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
if kazi = 1 then
if diverx < (15 - (35 * left)) then
set direct to 1
end if
else
if getAt(alienx, 1) < (15 - (35 * left)) then
set direct to 1
end if
end if
if kazi = 33 then
if diverx > (577 + (35 * right)) then
set direct to -1
end if
else
if getAt(alienx, 33) > (577 + (35 * right)) then
set direct to -1
end if
end if
set count to count + 1
if count = 7 then
if alienship = 4 then
set alienship to 5
else
set alienship to 4
end if
set count to 1
end if
repeat with q = 3 to 35
set temp to getAt(alienblow, q - 2)
if temp = 6 then
if (q = 11) or (q = 12) or (q = 15) or (q = 16) or (q = 20) or (q = 21) or (q = 24) or (q = 25) or (q = 28) or (q = 29) then
set the castNum of sprite q to alienship
else
if (q = 4) or (q = 8) or (q = 10) or (q = 13) or (q = 14) or (q = 18) or (q = 19) or (q = 22) or (q = 23) or (q = 27) or (q = 33) or (q = 35) then
set the castNum of sprite q to alienship + 2
else
if (q = 3) or (q = 5) or (q = 6) or (q = 7) or (q = 9) or (q = 17) or (q = 26) or (q = 30) or (q = 31) or (q = 32) or (q = 34) then
set the castNum of sprite q to alienship + 4
end if
end if
end if
set the locH of sprite q to getAt(alienx, q - 2)
set the locV of sprite q to getAt(alieny, q - 2)
next repeat
end if
if temp = 7 then
set the castNum of sprite q to 11
set the locH of sprite q to getAt(alienx, q - 2)
set the locV of sprite q to getAt(alieny, q - 2)
else
if temp = 8 then
set the castNum of sprite q to 11 + random(2)
set the locH of sprite q to getAt(alienx, q - 2)
set the locV of sprite q to getAt(alieny, q - 2)
else
if temp = 9 then
set the castNum of sprite q to 11
set the locH of sprite q to getAt(alienx, q - 2)
set the locV of sprite q to getAt(alieny, q - 2)
else
if (temp = 10) or (temp = 0) then
set the castNum of sprite q to 3
set the locH of sprite q to -50
set the locV of sprite q to -50
end if
end if
end if
end if
set temp to temp + 1
if temp = 10 then
deleteAt(alienblow, q - 2)
addAt(alienblow, q - 2, 0)
next repeat
end if
if (temp = 8) or (temp = 9) then
deleteAt(alienblow, q - 2)
addAt(alienblow, q - 2, temp)
end if
end repeat
if (shoot1 = 0) and (kazi > 0) and (random(10) = 1) then
if getAt(alienblow, kazi) = 6 then
if soundBusy(2) = 0 then
puppetSound(2, "DROP")
end if
set shoot1 to kazi
set shoot1x to getAt(alienx, shoot1)
set shoot1y to getAt(alieny, shoot1) + 10
else
set shoot1 to 0
end if
end if
if (shoot2 = 0) and (random(100) < (level * level * 3)) then
set temp to random(33)
if getAt(alienblow, temp) = 6 then
set shoot2 to temp
if (shoot2 <> shoot1) and (shoot2 <> shoot3) and (shoot2 <> shoot4) then
if soundBusy(2) = 0 then
puppetSound(2, "DROP")
end if
set shoot2x to getAt(alienx, shoot2)
set shoot2y to getAt(alieny, shoot2) + 10
else
set shoot2 to 0
end if
end if
end if
if (shoot3 = 0) and (random(100) < (level * level * 3)) then
set temp to random(33)
if getAt(alienblow, temp) = 6 then
set shoot3 to temp
if (shoot3 <> shoot1) and (shoot3 <> shoot2) and (shoot3 <> shoot4) then
if soundBusy(2) = 0 then
puppetSound(2, "DROP")
end if
set shoot3x to getAt(alienx, shoot3)
set shoot3y to getAt(alieny, shoot3) + 10
else
set shoot3 to 0
end if
end if
end if
if (shoot4 = 0) and (random(100) < (level * level * 3)) then
set temp to random(33)
if getAt(alienblow, temp) = 6 then
set shoot4 to temp
if (shoot4 <> shoot1) and (shoot4 <> shoot2) and (shoot4 <> shoot3) then
if soundBusy(2) = 0 then
puppetSound(2, "DROP")
end if
set shoot4x to getAt(alienx, shoot4)
set shoot4y to getAt(alieny, shoot4) + 10
else
set shoot4 to 0
end if
end if
end if
if shoot1 > 0 then
set shoot1y to shoot1y + 13
if (shoot1y > 320) and (shoot1y < 360) and (shipcast = 1) and sprite 36 intersects 40 then
set collide to 1
set shoot1 to 0
end if
if shoot1y > 401 then
set shoot1 to 0
end if
set the castNum of sprite 36 to 10
else
set the castNum of sprite 36 to 3
set shoot1x to 600
set shoot1y to -50
end if
set the locH of sprite 36 to shoot1x
set the locV of sprite 36 to shoot1y
if shoot2 > 0 then
set shoot2y to shoot2y + 7
if (shoot2y > 320) and (shoot2y < 360) and (shipcast = 1) and sprite 37 intersects 40 then
set collide to 1
set shoot2 to 0
end if
if shoot2y > 401 then
set shoot2 to 0
end if
set the castNum of sprite 37 to 10
else
set the castNum of sprite 37 to 3
set shoot2x to 600
set shoot2y to -50
end if
set the locH of sprite 37 to shoot2x
set the locV of sprite 37 to shoot2y
if shoot3 > 0 then
set shoot3y to shoot3y + 8
if (shoot3y > 320) and (shoot3y < 360) and (shipcast = 1) and sprite 38 intersects 40 then
set collide to 1
set shoot3 to 0
end if
if shoot3y > 401 then
set shoot3 to 0
end if
set the castNum of sprite 38 to 10
else
set the castNum of sprite 38 to 3
set shoot3x to 600
set shoot3y to -50
end if
set the locH of sprite 38 to shoot3x
set the locV of sprite 38 to shoot3y
if shoot4 > 0 then
set shoot4y to shoot4y + 9
if (shoot4y > 320) and (shoot4y < 360) and (shipcast = 1) and sprite 39 intersects 40 then